namespace ResourceLoader.DeserializeTool
{
    /// <summary>
    /// 资源的信息
    /// </summary>
    public struct ResourceInfo
    {
        /// <summary>
        /// 索引位置
        /// </summary>
        public long Index;

        /// <summary>
        /// 资源大小(单位byte)
        /// </summary>
        public long Length;

        /// <summary>
        /// 文件名字
        /// </summary>
        public string FileName;


        public void Copy(ResourceInfo resourceInfo)
        {
            Index = resourceInfo.Index;
            Length = resourceInfo.Length;
            FileName = resourceInfo.FileName;
        }

        /// <summary>
        /// 当前是否有有效值
        /// </summary>
        /// <returns></returns>
        public bool IsNull()
        {
            return FileName == null;
        }

        /// <summary>
        /// 清空
        /// </summary>
        public void Clear()
        {
            Index = 0;
            Length = 0;
            FileName = null;
        }
    }
}